package hydrap2p.gui;

import java.util.ArrayList;
import java.util.List;

/**
 * A class that wraps a search request.  It contains a list of terms that can exist (OR),
 * a list of terms that must exist (AND), and a list of terms that cannot exist (NOT).
 * 
 * @author Jared
 */
public class SearchObject
{
	//whether or not certain protocols are being checked
	List<String> protocols;
	
	//terms that will be searched
	List<String> includeAnyTerms;
	List<String> includeAllTerms;
	List<String> includeNoTerms;
	
	ArrayList<String> terms;
	
	/**
	 * Initializes the variables
	 * 
	 * @param any	an ArrayList of the terms that can exist
	 * @param all	an ArrayList of the terms that must exist
	 * @param no	an ArrayList of the terms that cannot exist
	 * @param hChk	check HTTP
	 * @param btChk	check BitTorrent
	 */
	 
	public SearchObject(List<String> any, List<String> all, List<String> no, List<String> modules)
	{	
		includeAnyTerms = any;
		includeAllTerms = all;
		includeNoTerms = no;
		protocols = modules;
		
		terms = new ArrayList<String>();
		terms.addAll(any);
		terms.addAll(all);
		terms.addAll(no);
		
	}
	
	public ArrayList<String> getTerms(){
		return terms;
	}
	
	public List<String> getAnyTerms(){
		return includeAnyTerms;
	}
	
	public List<String> getAllTerms(){
		return includeAllTerms;
	}
	
	public List<String> getNoTerms(){
		return includeNoTerms;
	}
	
	public List<String> getProtocols(){
		return protocols;
	}
	
}
